import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 28779
 * Date: 2023-03-20
 * Time: 8:10
 */

class Student{
    private int age;
    private String name;

    public Student(){
        this(22,"xiao zou");
        System.out.println("不带参数的构造方法！");
    }

    public Student(int age, String name) {
        this.age = age;
        this.name = name;
        System.out.println("带参数的构造方法！ ");
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void print(){
        System.out.println(this.name + " 年龄是 " + this.age);
    }
}
public class Test {
    public static void main(String[] args) {
        Student student2 = new Student();
        Student student1 = new Student(21,"xiao zhang");
        student1.print();
        student2.print();
/*        student2.setName("zhang");
        student2.setAge(21);*/

/*        System.out.println(student2.getAge());
        System.out.println(student2.getName());*/
    }
}




